package mvc;

import java.awt.Dimension;
import java.awt.Graphics;

import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;
import javax.swing.JPanel;

import mvc.bezier.BezierMouseController3D;
import mvc.tubolar.TubolarModel;

import org.geom.Point3D;
import org.geom.curve.ICurve;
import org.geom.render.ViewJOGL;
import org.geom.render.RenderManager;
import org.geom.surface.ISurface;
import org.geom.surface.tubolar.TubolarSurface;

public abstract class ViewSurface extends ViewJOGL {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	//-------------------------------------------------------- classvars
	//-------------------------------------------------------- render vars
	

	//-------------------------------------------------------- mvc vars
	protected TubolarModel surface;

	
	//-------------------------------------------------------- constructor
	/** the child class that extends View must initializate the renderer */
	public ViewSurface(ISurface model, Dimension d) {
		super();
		this.surface = (TubolarModel) model;
		
		this.setPreferredSize(d);
		this.setVisible(true);
		this.addGLEventListener(this);
		
	}
	
	
	public void addMouseKeybController(SurfaceControllerMouse3D controller3d) {
		addMouseListener(controller3d);
		addMouseMotionListener(controller3d);
		addKeyListener(controller3d);
	}
	
	
	//-------------------------------------------------------- render device delegation
	//-------------------------------------------------------- publics
	
	@Override
	public void render(GL gl) {

	}
	
	public Point3D getRotate() {
		return this.r_offset;
	}

	public Point3D getScale() {
		return null;
	}

	public Point3D getTranslate() {
		return t_offset;
	}

	public void setRotate(Point3D r) {
		this.r_offset = r;
	}

	public void setScale(Point3D s) {
	}

	public void setTranslate(Point3D t) {	
		this.t_offset = t;
	}

	public Point3D transform3dTo3D(Point3D p) {
		return null;
	}

}
